import Vue from 'vue'
import VueRouter from 'vue-router'

import details from "../views/Details.vue"
import Table from '../components/Table.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/user'
  },
  {
    path: '/user',
    component: Table
  },
  {
    path: '/details/:id',
    component: details,
    props: true
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router